package stub;

import databaseservice.OrderItemPOService;
import databaseservice.OrderPOService;
import po.OrderItemPO;
import po.OrderPO;
import businesslogic.network.RMIStubClient;
import businesslogicservice.PurchaseBookBLService;

public class PurchaseBookBLService_Stub implements PurchaseBookBLService {
	private OrderItemPOService mOrderItemPOService;
	private OrderPOService mOrderPOService;
	
	public PurchaseBookBLService_Stub(RMIStubClient client){
		mOrderItemPOService=client.orderItemPOService;
		mOrderPOService=client.orderPOService;
	}

	@Override
	public boolean addAnItem(OrderItemPO o) {
		// TODO Auto-generated method stub
		try {
			return mOrderItemPOService.add(o);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			return false;
		}
		
	}

	@Override
	public boolean deleteAnItem(OrderItemPO o) {
		// TODO Auto-generated method stub
		try {
			return mOrderItemPOService.delete(o);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			return false;
		}
		
	}

	@Override
	public boolean emptyTrolley() {
		// TODO Auto-generated method stub
		return true;
	}

	@Override
	public boolean makeAnOrder(OrderPO o) {
		// TODO Auto-generated method stub
		try {
			return mOrderPOService.add(o);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			return false;
		}
		
	}

}
